import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    n:1
  },
  getters: {
    money(state){
      return "¥"+ state.n
    }
  },
  actions: {
    jia({commit}){

       setTimeout(()=>{
          commit( "jiajia",1 )
       },3000)
    }

  },
  mutations: {
    jiajia(state,m){
      state.n +=m;
    }
 },
  modules: {
  }
})
